package pers.gxm.abstractfactory.factory;

public abstract class Item {
    protected String caption;
    /**
     * 默认的标签层级
     */
    protected int elementLevel = 3;
    public Item(String caption){
        this.caption = caption;
    }

    public abstract String makeHTML();

    public abstract void increaseElementLevel();

    /**
     * 给标签添加与其层级匹配的缩进
     */
    public  void addTab(StringBuffer sb){
        for(int i = 0;i < elementLevel;i++){
            sb.append("\t");
        }
    };
}
